<?php
  require_once("includes/config.php"); 
//Edit Pop-up"
  if($_SERVER["REQUEST_METHOD"] == "POST")
  {
    $name = $_POST['name'];
    $client_type = $_POST['client_type'];
    $nationality= $_POST['nationality'];
    $identification_type= $_POST['identification_type'];
    $identification_number =$_POST['identification_number'];
    $publication_place = $_POST['publication_place'];
    $expiry_date= $_POST['expiry_date'];
    $mobile = $_POST['mobile'];
    $phone= $_POST['phone'];
    $email=$_POST['email'];
    $workplace= $_POST['workplace'];
    $adress=$_POST['adress'];
    $Notes = $_POST['Notes'];
    $card_copy = $_POST['card_copy'];
    
    $update = query("UPDATE clients SET name=? , identification_type =? ,identification_number = ? ,publication_place=? ,
                     expiry_date = ? ,adress = ? , mobile = ? ,email= ? ,workplace =? ,phone=? ,Notes=? , nationality = ? ,client_type = ? WHERE id= ? and card_copy= ?" 
             ,$name, $identification_type ,
             $identification_number ,$publication_place , $expiry_date,$adress ,$mobile ,$email,$workplace ,
            $phone ,$Notes ,$nationality,$client_type ,$_POST['client_id'],$card_copy) ;
            
    $_SESSION['success_message'] = "تم تعديل العميل بنجاح"; 
  
    redirect("customers.php");
  }
  else
    apologize("Sorry!");
  
  ?>